package com.flyme.module.base.client.api;


import com.flyme.common.core.model.ResultBody;
import com.flyme.module.base.client.dto.SysAccountDto;
import com.flyme.module.base.client.entity.SystemAccount;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zyf
 */
public interface SysAccountRemoteService {
    /**
     * 登录
     *
     * @param username 登录名
     * @return
     */
    @GetMapping("/account/login")
    ResultBody<SysAccountDto> login(@RequestParam(value = "username") String username);

    /**
     * 注册第三方登录账号
     *
     * @param account
     * @param password
     * @param accountType
     * @return
     */
    @PostMapping("/account/register/thirdParty")
    ResultBody<SystemAccount> registerThirdPartyAccount(
        @RequestParam(value = "account") String account,
        @RequestParam(value = "userhead") String userhead,
        @RequestParam(value = "nickName") String nickName,
        @RequestParam(value = "accountType") String accountType
    );

    /**
     * 修改密码
     *
     * @param password
     * @param newPass
     * @return
     */
    @PostMapping("/account/resetPassword")
    ResultBody<Object> resetPassword(@RequestParam("password") String password, @RequestParam("newPass") String newPass);
}
